GXPrintPage
You can use theGXPrintPage
function to print a page in a document if your application stores each page as a single picture shape.
void GXPrintPage (gxJob aJob, long pageNumber, gxFormat aFormat, gxShape aPage);
aJob
- A reference to the job object whose page you want to print.
pageNumber
The page number for the page.aFormat
- A reference to the format object for the page.
aPage
- A reference to the picture shape that specifies the output for the page.
DESCRIPTION
TheGXPrintPage
function prints a page of a document. In theaPage
parameter, you specify the picture shape for each page. In thepageNumber
parameter, you set the page to print. QuickDraw GX compares the specified page number with the page range chosen by the user and spools the page if it is within the page range. If it is not within the range, QuickDraw GX ignores the data.In the
aFormat
parameter, you specify the format object for the page. You need to provide your own mechanism for associating individual document pages with format objects.You should loop through each page of a document, calling the
GXPrintPage
function for each page's picture shape. You should check for errors after you print each page and exit the loop if necessary.If your application does not store each page as a single picture shape, you should use the
GXStartPage
,GXDrawShape
, andGXFinishPage
functions to print the page.RESULT CODES
gxPrUserAbortErr The user has canceled printing. gxSegmentLoadFailedErr A required code segment could not be found, or there was not enough memory to load it. SEE ALSO
Listing 2-5 on page 2-21 shows how to use theGXPrintPage
function to print each page of a document.Picture shapes are discussed in Inside Macintosh: GX Graphics.
The
GXStartPage
function is described on page 2-66. TheGXFinishPage
function is described on page 2-67. TheGXDrawShape
function is described in the shape objects chapter of Inside Macintosh: GX Objects.In addition to the result codes listed above, you may also receive errors that can occur while flattening graphics objects during spooling. For more information about the spooling phase of printing, see the chapter "Introduction to Printing With QuickDraw GX" in this book. Flattening graphics objects is described in the shape objects chapter of Inside Macintosh: GX Objects.
Main | Page One | What's New | Apple Computer, Inc. | Find It | Contact Us | Help